package com.googlecode.agscrum.model.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@SequenceGenerator(name = "document_sequence", sequenceName = "document_sequence")
public class Document {
	@Id
	@GeneratedValue(generator = "document_sequence", strategy = GenerationType.SEQUENCE)
	@Column(name = "id_document")
	private Long id;
	@Column(length = 120, nullable = false)
	private String name;
	@Lob
	@Column(nullable = false)
	private String description;
	@Temporal(TemporalType.TIMESTAMP)
	private Date date;
	@ManyToOne
	@JoinColumn(name = "id_product", nullable = false)
	private Product product;
}
